<div class="categories view">
	<div id="totals"><h4>Category Totals</h4>
	<?
		foreach($totals as $t) {
			?><div class="<?= $t['period'] ?>">
				<span class="period"><?= ucfirst($t['period']) ?></span> :
				<span class="amount"><?= $number->currency($t['amount'], $Settings['currency']) ?></span>
			</div><?
		}
	?>
	</div>
	<?
		$category_name = $ebocash->category($category['Category']['name']);
	?>
	<h2><?php echo $category_name; ?></h2>
	<p><?php echo $html->link(__('Edit', true), array('action'=>'edit', $category['Category']['id'])); ?> </p>

	<div class="related">
		<h3><?php __('Purchases');?></h3>
		<?
		echo $form->create('Category', array('url' => array('controller'=>'categories', 'action'=>'reassign')));

		echo $this->renderElement('purchases', array('fieldName' => 'Purchase.id'));

		?><div class="reassign"><?
		echo $form->select('id', $allCategories);
		echo $form->input('redirect', array('type'=>'checkbox', 'label'=>'Go to new category when done?'));
		echo $form->hidden('original', array('value'=>$category['Category']['id']));
		echo $form->hidden('page', array('value' => $paginator->counter(array('format' => '%page%'))));

		echo $form->submit('Re-assign');
		?></div><?

		echo $form->end();

		echo $paginator->options(array('url' => array('controller'=>'categories','action'=>'view', $category['Category']['id'])));
		echo $paginator->numbers();
		?>

	</div>
</div>
